package com.willpower.eureka.auth.response;

/**
 * @author: wen-yi;
 * @date: 2021/11/2 21:31;
 * @Description:
 */
public enum ResultCode implements CustomizeResultCode {
    /*成功*/
    SUCCESS(200,"成功"),
    /*失败*/
    COMMON_FAIL(999,"失败"),
    ENC_KEY_FAIL(1000,"获取密钥失败"),
    /*参数错误*/
    PARAM_NOT_VALUE(1001,"参数无效"),
    PARAM_IS_BLANK(1002,"参数为空"),
    PARAM_TYPE_ERROR(1003,"参数类型错误"),
    PARAM_NOT_COMPLETE(1004,"参数缺失"),
    /*用户异常*/
    USER_NOT_LOGIN(2001,"用户未登录"),
    USER_ACCOUNT_EXPIRED(2002,"账号已过期"),
    USER_CREDENTIALS_ERROR(2003,"密码错误"),
    USER_CREDENTIALS_EXPIRED(2004,"密码过期"),
    USER_ACCOUNT_DISABLE(2005,"账号不可用"),
    USER_ACCOUNT_LOCKED(2006,"账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(2007,"账号不存在"),
    USER_ACCOUNT_ALREADY_EXIST(2008,"账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(2009,"您已经在别处登录，如不是您的操作，请尽快修改密码"),
    USER_SESSION_INVALID(2010,"登录超时,请重新登录"),
    USER_VERIFY_CODE_EXPIRED(2011,"验证码错误"),
    /*业务异常*/
    NO_PERMISSION(4001,"没有权限"),
    /*部门异常*/
    DEPARTMENT_NOT_EXIST(5007,"部门不存在"),
    DEPARTMENT_ALREADY_EXIST(5008,"部门已存在"),
    /*运行时异常*/
    ARITHMETIC_EXCEPTION(9001,"算术异常"),
    NULL_POINTER_EXCEPTION(9002,"空指针异常"),
    ARRAY_INDEX_OUTOfBOUNDS_EXCEPTION(9003,"数组越界");

    private Integer code;
    private String msg;

    ResultCode(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return msg;
    }
}
